from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop0"
firefox=openBrowser(url)
firefox.get(urlAdmin)
#调用自定义函数进行后台的登录
DBshopLoginAdmin(firefox)
# 8.进入销售管理订单管理,找到刚才前台提交的订单,点击"编辑查看",再点击付款操作按钮
#调用后台的菜单操作函数
DBshopEnterMenu2(firefox,'销售管理','订单管理')
firefox.find_element_by_xpath('//option[text()="默认状态"]').click()
firefox.find_element_by_xpath('//option[text()="已取消"]').click()
firefox.find_element_by_xpath('(//button[@class="btn btn-small btn-primary"])[1]').click()
firefox.find_element_by_xpath('//input[@value="34"]').click()
firefox.find_element_by_xpath('//option[text()="请选择"]').click()
firefox.find_element_by_xpath('//option[text()="删除"]').click()
firefox.find_element_by_xpath('(//button[@class="btn btn-small btn-primary"])[3]').click()
# 处理js脚本弹窗，alert表示js脚本警告窗口
firefox.switch_to.alert.accept()
#断言
try:
    writeLog("%s 测试通过"%testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()